<#assign css> </#assign>
<#assign js> </#assign>
<#import "/admin/common/home.html" as home>
<#escape x as (x)!"">
<@home.home pagecss=css pagejs=js>
<form action="list" id="pageListForm" method="post" class="form-inline">
	<div class="search">
		<div class="form-group">
			<input type="text" name="name" value="${param.name}" class="form-control" placeholder="请输入角色名称" />
		</div>
		<div class="form-group">
			<select name="state" class="form-control" data-val="${param.state}">
					<option value="">-请选择状态-</option>
					<option value="1">启用</option>
					<option value="2">停用</option>
			</select>
		</div>
		<div class="form-group">
			<a href="javascript:;" class="btn btn-search " id="btn-search">查询</a>
		</div>
	</div>
	
	<div class="main-container">
		<div class="toolbar">
			<a href="javascript:;" class="btn btn-primary" onclick="admin.dialog(this);" data-width="680" data-height="500" data-url="form" data-title="新增角色">新增</a>
			<a href="javascript:;" class="btn btn-delete"
				onclick="tab.del(this);" data-url="delete" data-tips="确定批量删除选中的角色吗？">批量删除</a>
			<a href="javascript:;" class="btn btn-other"
				onclick="tab.updateState(this, 2);" data-url="updateState" data-tips="确定批量禁用选中的角色吗？">批量禁用</a> 
			<a href="javascript:;" class="btn btn-other"
				onclick="tab.updateState(this, 1);" data-url="updateState" data-tips="确定批量启用选中的角色吗？">批量启用</a>
		</div>
		<table class="table table-bordered table-hover">
			<caption class="caption none" id="chkedInfo">
				<div class="caption-table">
					你已经选择<em id="chkLength" class="chkNumber">0</em>条记录！ 
					<span class="none">选择的值是：<input type="text" name="chkTotal" id="chkTotalVal" value="" /></span>
				</div>
			</caption>
			<thead class="thead thead-more">
				<tr>
					<th class="ui-td-chk"><input type="checkbox" name="checkAll" id="chkAll" /></th>
					<th class="ui-td-no">序号</th>
					<th>角色名称</th>
					<th style="width:30%;">角色说明</th>
					<th class="ui-td-time">创建时间</th>
					<th class="ui-td-status">状态</th>
					<th class="ui-td-oper">权限设置</th>
					<th class="ui-td-oper">操作</th>
				</tr>
			</thead>
			<tbody class="tbody mod-tbody">
				<#if page?? && page.list ?? && page.list?size gt 0>
				<#list page.list as item>
				<tr>
					<td class="ui-td-chk">
						<#if (!item.superFlag?exists || item.superFlag != 1)>
						<input type="checkbox" name="chkItem" value="${item.id}" extVal="${item.id}" />
						</#if>
					</td>
					<td class="ui-td-no">${item_index + 1}</td>
					<td>${item.name}</td>
					<td style="width:30%;word-break:break-all;">${item.remarks}</td>
					<td class="ui-td-time"><span class="time">${item.createTime}</span></td>
					<td class="ui-td-status">
						<#if item.state==1>
							<span class="status-yes">启用</span>
						<#else>
							<span class="status-no">禁用</span>
						</#if>
					</td>
					<td class="ui-td-oper">
						<#if (!item.superFlag?exists || item.superFlag != 1) && item.id gt 0>
						<a href="javascript:;" onclick="admin.iframe(this);"  title="分配权限" data-url="resource?id=${item.id}" data-title="分配权限" class="ui-link-edit">分配权限</a>
						</#if>
					</td>
					<td class="ope-color">
						<#if item.id gt 0>
							<#if (!item.superFlag?exists || item.superFlag != 1)>
							<a href="javascript:;" onclick="admin.dialog(this);" data-width="680" data-height="500" class="ui-ico-tips ui-ico-edit" title="编辑" data-url="form?id=${item.id}" data-title="编辑管理员">编辑</a> 
							<a href="javascirpt:;" class="ui-ico-tips ui-ico-delete" onclick="tab.del(this);" title="删除" 
	                        	data-id=${item.id} data-url="delete" data-tips="确定删除该角色吗？">删除</a> 
							</#if>
							<#if item.state != 1>
							<a href="javascript:;" class="ui-ico-tips ui-ico-unLock" onclick="tab.updateState(this,'1');" 
								data-id="${item.id}"  data-url="updateState" data-tips="确定要启用该角色吗？" title="启用">启用</a> 
							<#else>
							<a href="javascript:;" class="ui-ico-tips ui-ico-lock" onclick="tab.updateState(this,'2');" 
								data-id="${item.id}"  data-url="updateState" data-tips="确定要禁用该角色吗？" title="禁用">禁用</a> 
							</#if>
							<a href="javascript:;" class="ui-link-edit" onclick="admin.iframe(this);" data-width="680" data-height="500" data-url="/admin/oplog/list/object?objectAlias=SysRole&objectId=${item.id}" data-title="操作日志">操作日志</a>
						</#if>
					</td>
				</tr>
				</#list>
			<#else>
				<tr>
					<td colspan="8"><p class="no-data">没有相关数据</p></td>
				</tr>
			</#if>
			</tbody>
		</table>
		<div class="ui-page">
			<#include "/admin/common/page.html">
		</div>
	</div>
</form>
</@home.home>
</#escape>
